# Copyright 1999-2008 Gentoo Foundation             
# Distributed under the terms of the GNU General Public License v2
# $Header: $                                                      

EAPI="2"

inherit eutils subversion flag-o-matic cmake-utils
MY_PN="${PN/qutim-/}"

DESCRIPTION="@Mail.ru protocol plugin for net-im/qutim"
HOMEPAGE="http://www.qutim.org"
LICENSE="GPL-2"
ESVN_REPO_URI="http://qutim.org/svn/${MY_PN}/trunk"

SLOT="live"
KEYWORDS=""
IUSE="debug"

RDEPEND="net-im/qutim:live"

DEPEND="${RDEPEND}
	>=dev-util/cmake-2.6
	!x11-plugins/qutim-mrim:0.2"

RESTRICT="debug? ( strip )"

src_unpack()
{
        subversion_src_unpack
}

src_prepare()
{
	if (use debug) ; then
		unset CFLAGS CXXFLAGS
		append-flags -O1 -g -ggdb
		CMAKE_BUILD_TYPE="debug"
	fi

	mycmakeargs="-DAPPLE=0 -DUNIX=1 -DWIN32=0 -DCMAKE_INSTALL_PREFIX=/usr"

	CMAKE_IN_SOURCE_BUILD=1

	sed -i '/if ( !WIN32 )/d' ${S}/CMakeLists.txt
	sed -i "/DESTINATION/s/lib/$(get_libdir)/g" ${S}/CMakeLists.txt
}

